package com.jhy.log4jdemo.controller;


import com.jhy.log4jdemo.annotation.LogAnnotation;
import com.jhy.log4jdemo.pojo.User;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class loginController {

    @LogAnnotation
    @PostMapping("/login")
    public String login(@RequestBody User user) {
        System.out.println(user);
        return "hello world login success";
    }

    @PostMapping("/add/{num}")
    public String add(@PathVariable Integer num) {
        System.out.println("传入的参数num = " + num);
        return "add success";
    }
}
